<%-- 
    Document   : adm_seleccionarIngrediente
    Created on : 14-nov-2010, 22:47:42
    Author     : Aldo
--%>

<%@page contentType="text/html" pageEncoding="windows-1252"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">        
        <link href="css/style.css" href="css/style.css" rel="stylesheet" type="text/css" />
        <script type="text/javascript" src="js/jquery-1.4.1.js"></script>
        <script type="text/javascript" src="js/jquery-ui-1.7.2.custom.min.js"></script>
        <!--[if lt IE 8]>
        <link href="style_IE.css" rel="stylesheet" type="text/css" media="all" />
        <![endif]-->
         <script type="text/javascript">
           function fSaveData(){
               var values = $('#__IDs');
                values.val('');

                $('.Select').each(function(){
                  if($(this).attr('checked')){
                    if(values.val()==""){
                      values.val($(this).val());
                    }else{
                      values.val(values.val()+';'+$(this).val());
                    }
                  }
                });

                if($('#__IDs').val()!=''){
                     window.parent.fGrabarIngredienteSeleccionados($('#__IDs').val());
                     window.parent.CloseMultiPopup("keySeleccionarIngrediente")
                }else{
                    alert("No ha seleccionado un Ingrediente");
                }
          }

          function seleccionarTodos(obj){            
              if($(obj).attr('checked')){
                   $('.Select').attr('checked',true)
               }else {                     
                   $('.Select').attr('checked',false);
               }
          }
    </script>
    </head>
    <body>
        <%@ include file="common/taglibs.jsp"%>
        <input type="hidden" name="" value="" id="__IDs"/>
        <div style ="text-align:left">
            <div class="">
                <div class="leftblock vertsortable" style="width:620px;margin:2px 2px 2px 2px">
                     <div class="gadget">
                        <div class="titlebar">
                            <h3>Seleccionar Ingredientes : </h3>
                        </div>
                        <div class="gadgetblock">

                               <form action="" method="post" id="form_tabexample" class="form_example">
                               <table width="100%" border="0" cellspacing="0" cellpadding="0" class="gwlines arborder">
                                    <tr>
                                      <th width="40" class="rborder"><input name="utc1" id="utc1"  type="checkbox" onclick="javascript:seleccionarTodos(this)" /></th>
                                      <th width="400" class="rborder">Descripcion</th>
                                      <th width="50" class="rborder">Cantidad</th>
                                    </tr>

                                        <c:forEach var="ingrediente" items="${ingredientes}">
                                        <tr>
                                          <td class="rborder"><input name="utc2" value="<c:out value="${ingrediente.iding}"/>" type="checkbox" class="Select" /></td>
                                          <td class="rborder"><c:out value="${ingrediente.desing}"/>&nbsp;</td>
                                          <td class="rborder"><input name="cantidad" id="cantidad" style="width: 40px">&nbsp;</td>
                                        </tr>
                                        </c:forEach>
                                   </table>
                               </form>

                        </div>
                    </div>
                </div>
            </div>
        </div>                
    </body>
</html>
